#include "stats.h"
#include <cmath> 

double mean(vector myArray, unsigned int N)
{
	unsigned int i;
	double average = 0;
	for (i=1; i<=N; i++) 
	{
		average+=myArray[i-1]/N;
	}
	return average;
}

double stdDev(vector myArray, unsigned int N, double average)
{
	unsigned int i;
	double ans = 0, st_dev = 0;

	for (i=1; i<=N; i++) {
		ans+=((myArray[i-1]-average)* (myArray[i-1]-average));}

	st_dev=sqrt(ans/double(N)); 		
	return st_dev;
}